//
// Created by 束庆乐 on 2024/12/21.
//
#include "stdio.h"
#include <string.h>
int main031(void){
    char str[] = "hello,world!";
    size_t length;
    length = strlen(str);
    char ss[] = "你";
    printf("字符串%s的长度为%d\n",str,length);
    printf("字符串 %s 的长度为%d\n",ss, strlen(ss));
    printf("字符串 %s 的长度为%zu\n",ss, strlen(ss));
    

    char strSrc[] = "你好";
    char strDes[strlen(strSrc)];
    strcpy(strDes,strSrc);
    printf("strDes字符串 %s 的长度为%d\n",strDes, strlen(strDes));

    //拼接字符串
    char dest[20] = "hello,";
    char src[] = "world";
    strcat(dest,src);
    printf("%s\n",dest);

    //比较字符串
    char s1[] = "2";
    char s2[] = "1";
   int result =  strcmp(s1,s2);
    printf("%d",result);
    return 0;
}
